import request from '@/utils/request'
/**
 * 获取设计变更详情
 * @param {*} id
 * @returns
 */
export function getDetail(id) {
  return request({
    url: `/api/v1/shopDesignChange/${id}/info`,
    method: 'get'
  })
}

/**
 * 保存变更数据
 * @param {*} data
 * @returns
 */
export function saveDesignChange(data, type) {
  return request({
    url: `/api/v1/shopDesignChange/addShopDesignChange/?isSubmit=${type}`,
    method: 'post',
    data
  })
}

/**
 * 提交变更数据
 * @param {*} data
 * @returns
 */
export function designAreaSeriesChangeCommit(data) {
  return request({
    url: '/api/v1/shopDesignChange/addShopDesignChange',
    method: 'post',
    data
  })
}

/**
 * 提交变更数据
 * @param {*} data
 * @returns
 */
export function preserveAndCommit(data) {
  return request({
    url: '/api/v1/shopDesignChange/designAreaSeriesChangeCommit',
    method: 'post',
    timeout: 180000 * 6,
    data
  })
}

/**
 * 提交变更方案详情数据
 * @param {*} data
 * @returns
 */
export function preserveAndCommitChange(data) {
  return request({
    url: '/api/v1/shopDesignChange/designAreaSeriesChangeCommit',
    method: 'post',
    timeout: 180000 * 6,
    data
  })
}

/**
 * 获取门店设计详情
 * @param {*} constCode
 * @returns
 */
export function getDesignInfo(constCode) {
  return request({
    url: `/api/v1/shopDesign/getShopDesign/${constCode}/info`,
    method: 'get'
  })
}
/**
 * 获取设计变更门店设计详情
 * @param {*} constCode
 * @returns
 */
export function getChangeDesignInfo(id, constCode) {
  return request({
    url: `/api/v1/shopDesignChange/${id}/${constCode}`,
    method: 'get'
  })
}
/**
 * 保存系列变更数据
 * @param {*} data
 * @returns
 */
export function saveDesignSeriesChange(data) {
  return request({
    url: '/api/v1/shopDesignChange/addDesignAreaSeries',
    method: 'post',
    data
  })
}

/**
 * 终止变更数据
 * @param {*} data
 * @returns
 */
export function terminal(data) {
  return request({
    url: '/api/v1/shopDesignChange/termination',
    method: 'post',
    data
  })
}
